<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	

<ui:composition template="../templates/template.xhtml">
	<ui:define name="conteudo">
		<f:view>
			<div class="div_coluna_esquerda">
				<div class="div_livros_destaque">
					<rich:panel header="Pesquisar livro" style="font-size: 14px;">
						<h:form>
							<h:inputText id="sugesstionCategoria" value="#{categoriaMBean.sugestao}" />
							<rich:suggestionbox for="sugesstionCategoria" var="aux"
								suggestionAction="#{categoriaMBean.autocompletar()}"
								nothingLabel="Nada foi encontrado">
								<h:column>
									<h:outputText value="aux" />
								</h:column>
							</rich:suggestionbox>
							
							<br/><br/><br/>

							<rich:dataTable id="dataTable" value="#{livroMBean.all}"
								var="livro" rowKeyVar="index" rows="15">

								<rich:column width="5%">
									<f:facet name="header">
										<h:outputText value="Nº" />
									</f:facet>
									<h:outputText value="#{index+1}" />
								</rich:column>

								<rich:column width="80%" sortBy="#{livro.titulo}">
									<f:facet name="header">
										<h:outputText value="Título" />
									</f:facet>
									<h:outputText value="#{livro.titulo}" />
								</rich:column>

								<rich:column width="80%" sortBy="#{livro.autor}">
									<f:facet name="header">
										<h:outputText value="Autor" />
									</f:facet>
									<h:outputText value="#{livro.autor}" />
								</rich:column>

								<rich:column width="80%" sortBy="#{livro.categoria}">
									<f:facet name="header">
										<h:outputText value="Categoria" />
									</f:facet>
									<h:outputText value="#{livro.categoria}" />
								</rich:column>

								<f:facet name="footer">
									<rich:datascroller renderIfSinglePage="false" for="dataTable" />
								</f:facet>

							</rich:dataTable>
						</h:form>
					</rich:panel>
				</div>
			</div>
		</f:view>
	</ui:define>
</ui:composition>



</html>